package BullFightGame;

public class Deck {
	private  int number;
	private  int value;
	private  int literalnumber; 
	private  String color;
	private  String card;
	public static String[] colors={"♠","♣","♥","♦",""};
	
	public Deck(int number){
		if(number <=54){
			this.number=number;
			ActualValue();
			ActualCard();
			ActualColor();
			actualLiteralnumber();
				
		}
	}
	
	public static String numberToString(int number){
		 return new Deck(number).toString();
	}
	
	public int getNumber() {
		return number;
	}
	public int getValue() {
		return value;
	}
	public int getLiteralnumber() {
		return literalnumber;
	}
	public String getColor() {
		return color;
	}
	public String getCard() {
		return card;
	}
	private void actualLiteralnumber(){
		 if(number==54){
			 literalnumber=15;
		 }
		 else if(number==53){
			 literalnumber=14;
		 }
		 else
			 literalnumber=(number-1)/4+1;
	}
	private void ActualValue(){
	     if(number<=36){
	    	 value=(number-1)/4+1;
	     } else
	    	 value =10;
	}
	private void  ActualCard(){
		if(number==54){
			  card="Red Joker";
		}
		else if(number==53){
			card="Black Joker";
		}
		else if(number>40&&number<45){
			card="J";
		}
		else if(number>44&&number<49){
			card="Q";
		}
		else if(number>48&&number<53){
			card="K";
		}
		else if(number<5){
			card="A";
		}
		else
			card=""+((number-1)/4+1);
	}
	private  void ActualColor(){
		if(number>52){
			color=colors[colors.length-1];
		}
		else
			color=colors[(number-1)%4];

	}
	
	public  String toString(){
		return "["+color+card+"]";
	}

}	



